package com.keifo.final2.mapper;

import com.keifo.final2.entity.TeamMember;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TeamMemberMapper {

    @Select("SELECT * FROM team_member WHERE username = #{username}")
    TeamMember findByUsername(@Param("username") String username);

    @Select("SELECT * FROM team_member")
    List<TeamMember> findAll();

    @Insert("INSERT INTO team_member(username, password, name,note) VALUES(#{username}, #{password}, #{name}, #{note})")
    void insert(TeamMember member);

    @Update("UPDATE team_member SET password = #{password}, name = #{name},note= #{note} WHERE username = #{username}")
    void update(TeamMember member);

    @Delete("DELETE FROM team_member WHERE username = #{username}")
    void delete(@Param("username") String username);
}